package com.zretc.controller;


import com.common.core.domain.CodeMessage;
import com.zretc.pojo.LoginUserPojo;
import com.zretc.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class SysUserController {
    @Autowired
    IUserService service;
    /**
     * 获取当前用户信息
     */
    @GetMapping("/info/{username}")
    public CodeMessage<LoginUserPojo> info(@PathVariable("username") String username)
    {
        LoginUserPojo pojo = service.findByUsername(username);

        return  CodeMessage.ok(pojo);
    }
}
